import axios from "axios";
import service from "@/config/index";

// 发送手机验证码
async function sendCode(data) {
  let response = await axios.post(
    `${service.serviceTenant}/register/sms`,
    data
  );
  return response;
}

// 企业租户注册
async function tenantEnroll(data) {
  let response = await axios.post(
    `${service.serviceTenant}/register/tenant`,
    data
  );
  return response;
}

// 验证码效验
async function register(data) {
  let response = await axios.post(
    `${service.serviceTenant}/register/company`,
    data
  );
  return response;
}

// 图形验证码
async function graphicalValidate(params) {
  let response = await axios.get(`${service.serviceTenant}/captcha`, params);
  return response;
}

// 企业注册同意
async function enterpriseEnrollAgree(url, params) {
  return axios.post(url, params);
}

export {
  sendCode,
  tenantEnroll,
  graphicalValidate,
  register,
  enterpriseEnrollAgree
};
